home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Framewrk / FWPart / Include / FWEdCmd.h < prev    next >
Encoding:
Text File  |  1995-11-08  |  2.7 KB  |  101 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWEdCmd.h
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Copyright:    © 1995 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWEDCMD_H
  11. #define FWEDCMD_H
  12.  
  13. #ifndef FWCMD_H
  14. #include "FWCmd.h"
  15. #endif
  16.  
  17. // ----- OpenDoc Includes -----
  18.  
  19. #ifndef _ODTYPES_
  20. #include "ODTypes.h"
  21. #endif
  22.  
  23. #ifndef SOM_ODDraft_xh
  24. #include <Draft.xh>
  25. #endif
  26.  
  27. #if FW_LIB_EXPORT_PRAGMAS
  28. #pragma lib_export on
  29. #endif
  30.  
  31. //==============================================================================
  32. //    Forward Declarations
  33. //==============================================================================
  34.  
  35. class FW_CLASS_ATTR FW_CPart;
  36. class FW_CLASS_ATTR FW_CFrame;
  37. class FW_CLASS_ATTR FW_CSelection;
  38.  
  39. //==============================================================================
  40. // FW_CEditCommand - handles Cut, Clear, Paste, PasteAs commands
  41. //                     Subclass to make these commands Undo-able
  42. //==============================================================================
  43.  
  44. class FW_CLASS_ATTR FW_CEditCommand : public FW_CCommand
  45. {
  46.   public:
  47.     FW_DECLARE_CLASS
  48.  
  49.   public:
  50.     FW_CEditCommand(Environment* ev,
  51.                     ODCommandID id,
  52.                     FW_CFrame* frame,
  53.                     FW_Boolean canUndo);
  54.         // Constructor: undo/redo strings = NULL
  55.  
  56.     virtual ~ FW_CEditCommand();
  57.  
  58.     // --- Don't override ---
  59.     virtual void DoIt(Environment* ev);    // Override
  60.  
  61.     FW_Boolean HandleClear(Environment* ev);
  62.     void HandleCopy(Environment* ev);
  63.     FW_Boolean HandleCut(Environment* ev);
  64.     FW_Boolean HandlePaste(Environment* ev);
  65.     FW_Boolean HandlePasteAs(Environment* ev);
  66.  
  67.     // --- Override, call Inherited ---
  68.     virtual void UndoIt(Environment* ev);
  69.     virtual void RedoIt(Environment* ev);
  70.  
  71.     // --- May override, don't call Inherited ---
  72.     virtual void DoClear(Environment* ev);
  73.     virtual void DoCut(Environment* ev);
  74.     virtual void DoPaste(Environment* ev);
  75.     virtual void DoPasteAs(Environment* ev);
  76.  
  77.   protected:
  78.     // ----- Clipboard -----
  79.     void                    Copy(Environment* ev, FW_Boolean allowPublish);
  80.  
  81.     // ----- Linking/PasteAs -----
  82.     FW_Boolean                HandlePasteAsDialog(Environment* ev, ODPasteAsResult& pasteAsResult, 
  83.                                             FW_Boolean& handledIt);
  84.  
  85.     virtual FW_Boolean        DoPasteTranslation(Environment* ev, ODPasteAsResult& pasteAsResult);
  86.                             // Override to translate the data and paste it.
  87.  
  88.     virtual FW_Boolean        DoPasteAsEmbed(Environment* ev, ODStorageUnit* storageUnit);
  89.                             // Override to paste an embedded part.
  90.  
  91.   private:
  92.     ODUpdateID        fUpdateID;        // update id of clipboard for Cut, Paste
  93.     ODCloneKind        fCloneKind;        // cloneKind of operation
  94. };
  95.  
  96. #if FW_LIB_EXPORT_PRAGMAS
  97. #pragma lib_export off
  98. #endif
  99.  
  100. #endif
  101.